<?php
/**
 * sfActionsFnde extends sfActions and implements methods to filter
 * and pagination.
 *
 */
class sfComponentsFoxsis extends sfComponents
{
	public function getRequestParameter($name, $default = null)
	{
		if(is_array($name)) {
			$valor = $this->requestParameterHolder->get($name[0]);
			if(isset($valor[$name[1]])) {
				return $valor[$name[1]];
			}
			else {
				return $default;
			}
		}
		else {
			return $this->requestParameterHolder->get($name, $default);
		}
	}

	/**
	 * Sets a flash variable that will be passed to the very next action.
	 *
	 * @param  string  The name of the flash variable
	 * @param  string  The value of the flash variable
	 * @param  boolean true if the flash have to persist for the following request (true by default)
	 */
	public function setFlash($name, $value, $persist = true)
	{
		$this->getUser()->setFlash($name, $value, $persist);
	}

	/**
	 * Gets a flash variable.
	 *
	 * @param  string The name of the flash variable
	 *
	 * @return mixed The value of the flash variable
	 */
	public function getFlash($name)
	{
		return $this->getUser()->getFlash($name);
	}

	/**
	 * Returns true if a flash variable of the specified name exists.
	 *
	 * @param  string The name of the flash variable
	 *
	 * @return boolean   true if the variable exists, false otherwise
	 */
	public function hasFlash($name)
	{
		return $this->getUser()->hasFlash($name);
	}
}